package demo.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.context.annotation.PropertySource;

/**
 * 书属性
 *
 */

@Component
public class BookProperties {

    /**
     * 书名
     */
    @Value("${demo.book.name}")
    private String name;

    /**
     * 作者
     */
    @Value("${demo.book.writer}")
    private String writer;
    
    @Value("#{ T(java.lang.Math).random() }")
    private double rand;

    public String getName() {
        return name;
    }
    

    public void setName(String name) {
        this.name = name;
    }

    public String getWriter() {
        return writer;
    }

    public void setWriter(String writer) {
        this.writer = writer;
    }
    
    public void setRand(double rand)
    {
    	this.rand = rand;
    }
    public double getRand()
    {
    	return (double) this.rand;
    }
}
